//
//  ViewController.m
//  NSURLSessionStudyDemo
//
//  Created by zzp on 2018/5/6.
//  Copyright © 2018年 内蒙小猿. All rights reserved.
//

#import "ViewController.h"
#import "SessionGetPostViewController.h"
#import "DownLoadDelegateViewController.h"
#import "DownloadTaskViewController.h"
#import "DownLoadObserverProgressViewController.h"
#import "DownLoadOffLineViewController.h"
#import "SessionUpLoadViewController.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    
    
    
}
// 简单 get post
- (IBAction)GetPostbuttonClick:(id)sender {
    SessionGetPostViewController *getPostVC = [[SessionGetPostViewController alloc] init];
    [self presentViewController:getPostVC animated:YES completion:nil];
}

// 通过代理实现 断点下载
- (IBAction)DownLoadDelegateButtonClick:(id)sender {
    DownLoadDelegateViewController *downLoadDelegateVC = [[DownLoadDelegateViewController alloc] init];
    [self presentViewController:downLoadDelegateVC animated:YES completion:nil];
}

// 通过 NSURLSessionDownLoadTask 实现断点下载
- (IBAction)downLoadTaskButtonClick:(id)sender {
    DownloadTaskViewController *downloadTaskVC = [[DownloadTaskViewController alloc] init];
    [self presentViewController:downloadTaskVC animated:YES completion:nil];
}

//  断点、下载进度
- (IBAction)downLoadObserverButtonClick:(id)sender {
    DownLoadObserverProgressViewController *downLoadObserverProgressVC = [[DownLoadObserverProgressViewController alloc] init];
    [self presentViewController:downLoadObserverProgressVC animated:YES completion:nil];
}

// 离线 、 断点、下载进度、
- (IBAction)offLineButtonClick:(id)sender {
    
    DownLoadOffLineViewController *offLineVC = [[DownLoadOffLineViewController alloc] init];
    [self presentViewController:offLineVC animated:YES completion:nil];
}

// 上传文件
- (IBAction)uploadButtonClick:(id)sender {
    SessionUpLoadViewController *upLoadVC = [[SessionUpLoadViewController alloc] init];
    [self presentViewController:upLoadVC animated:YES completion:nil];
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
